﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frame.Lib.Core.Tree;

namespace Cms.Entity.Menu
{
    public partial class MenuInfo:TreeInfo
    {
        public override string GetTableName()
        {
            return "c_Menu";
        }
        public override string GetInsertSql()
        {
            return "insert into c_Menu ( [ID], [Name], [UpperID], [Path], [Depth], [Orders], [Code], [TypeID], [ArticleSmallImageSize], [ArticleBigImageSize], [PicSallImageSize], [PicBigImageSize], [PicSaveOrignImage]) values ( @ID, @Name, @UpperID, @Path, @Depth, @Orders, @Code, @TypeID, @ArticleSmallImageSize, @ArticleBigImageSize, @PicSallImageSize, @PicBigImageSize, @PicSaveOrignImage)";
        }
        public override string GetUpdateSql()
        {
            return "update c_Menu set  [Name] = @Name, [UpperID] = @UpperID, [Path] = @Path, [Depth] = @Depth, [Orders] = @Orders, [Code] = @Code, [TypeID] = @TypeID, [ArticleSmallImageSize] = @ArticleSmallImageSize, [ArticleBigImageSize] = @ArticleBigImageSize, [PicSallImageSize] = @PicSallImageSize, [PicBigImageSize] = @PicBigImageSize, [PicSaveOrignImage] = @PicSaveOrignImage where ID = @ID";
        }

       

        /// <summary>
        /// 编号
        /// </summary>
        public Int32? Code
        {
            get;
            set;
        }
        /// <summary>
        /// 栏目类型：设文章或图片，通过枚举实现
        /// </summary>
        public Int32 TypeID
        {
            get;
            set;
        }
        /// <summary>
        /// 文章小图尺寸
        /// </summary>
        public Int32 ArticleSmallImageSize
        {
            get;
            set;
        }
        /// <summary>
        /// 文章大图尺寸
        /// </summary>
        public Int32 ArticleBigImageSize
        {
            get;
            set;
        }
        /// <summary>
        /// 附件中小图尺寸
        /// </summary>
        public Int32 PicSallImageSize
        {
            get;
            set;
        }
        /// <summary>
        /// 附件中大图尺寸
        /// </summary>
        public Int32 PicBigImageSize
        {
            get;
            set;
        }
        /// <summary>
        /// 是否保存附件中的原始图片
        /// </summary>
        public Boolean PicSaveOrignImage
        {
            get;
            set;
        }

        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int32)value;
                    break;
                case "name":
                    this.Name = (String)value;
                    break;
                case "upperid":
                    this.UpperID = (Int32)value;
                    break;
                case "path":
                    this.Path = (String)value;
                    break;
                case "depth":
                    this.Depth = (Int32)value;
                    break;
                case "orders":
                    this.Orders = (Int32)value;
                    break;
                case "code":
                    this.Code = (Int32?)value;
                    break;
                case "typeid":
                    this.TypeID = (Int32)value;
                    break;
                case "articlesmallimagesize":
                    this.ArticleSmallImageSize = (Int32)value;
                    break;
                case "articlebigimagesize":
                    this.ArticleBigImageSize = (Int32)value;
                    break;
                case "picsallimagesize":
                    this.PicSallImageSize = (Int32)value;
                    break;
                case "picbigimagesize":
                    this.PicBigImageSize = (Int32)value;
                    break;
                case "picsaveorignimage":
                    this.PicSaveOrignImage = (Boolean)value;
                    break;
            }
        }
        public override object GetValue(string key)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    return this.ID;
                case "name":
                    return this.Name;
                case "upperid":
                    return this.UpperID;
                case "path":
                    return this.Path;
                case "depth":
                    return this.Depth;
                case "orders":
                    return this.Orders;
                case "code":
                    return this.Code;
                case "typeid":
                    return this.TypeID;
                case "articlesmallimagesize":
                    return this.ArticleSmallImageSize;
                case "articlebigimagesize":
                    return this.ArticleBigImageSize;
                case "picsallimagesize":
                    return this.PicSallImageSize;
                case "picbigimagesize":
                    return this.PicBigImageSize;
                case "picsaveorignimage":
                    return this.PicSaveOrignImage;
                default:
                    return null;
            }
        }

    }


}
